|
|
|
|
|
|
|
Heres a list of definitions of each of the bolded parameters in the syntax above. |
|
|
|
|
|
|
|
|
oRS is a Recordset object youve declared. |
|
|
|
|
|
|
|
|
Source can be a Command object, a SQL string, or the name of a file. |
|
|
|
|
|
|
|
|
ActiveConnection is either an active Connection object or a connection string. |
|
|
|
|
|
|
|
|
CursorType is a constant that determines the type of cursor that you want to open. The following are the valid cursor types: |
|
|
|
 |
|
|
|
|
adOpenForwardOnly. This is the default type of cursor opened if you dont pass in the cursor type. You use this type of cursor if all you want to do is to make one pass through the data. For example, if all you need to do is to load a list or combo box, use this type of cursor. This is a fast cursor, and it should be used as much as possible. |
|
|
|
 |
|
|
|
|
adOpenDynamic. A dynamic cursor is one in which, once its opened, you can scroll forward or backward through the data, edit the data, add new rows, or delete any row in the table. In addition, you can see any other users additions, edits, and deletions of the data pointed to by this cursor. Because it has so much functionality, this cursor has more overhead than any other cursor type. |
|
|
|
 |
|
|
|
|
adOpenKeyset. This is similar to the dynamic type of cursor, but you wont see other users additions, just other users edits and deletions. |
|
|
|
 |
|
|
|
|
adOpenStatic. This is a snapshot of the set of data at the time it is read. It can be updated, but any changes made by other users will not be visible. |
|
|
|
|
|
|
|
|
LockType is a constant that determines what type of locking (concurrency) you want to use for the recordset. It can be one of the following constants: |
|
|
|
 |
|
|
|
|
adLockReadOnly. This is the default lock type for a forward-only cursor. When this is set, youre only allowed to read datano editing can occur on a recordset created with this type of locking mechanism. |
|
|
|
 |
|
|
|
|
adLockPessimistic. When this type of locking is set, the data source may lock records immediately when editing starts on the data. This sometimes means right when the data is read from the data source. This can cause a lot of unnecessary locking for long periods of time. Not all data sources support this type of locking. If a data source does not support this type of locking, the driver will generally choose another lock type. |
|
|
|
|
|